%{
#include<stdio.h>
#include "parser.tab.h"

extern YYSTYPE yylval;

%}

DIGIT	[0-9]
NONDIGIT	[a-zA-Z]

%%
class|struct {
#ifdef DEBUG
	printf("class key: %s\n", yytext); 
#endif
	return CLASS_KEY; 
}

friend|typedef {
	return DECL_SPECIFIER;
}

inline|virtual|explicit {
	return FUNC_SPECIFIER;
}

auto|register|static|extern|mutable {
	return STORAGE_CLASS_SPECIFIER;
}

private|protected|public {
#ifdef DEBUG
	printf("access_specifier: %s\n", yytext);
#endif
	yylval = strdup(yytext);
	return ACCESS_SPECIFIER;
}

const|volatile {
	return CV_QUALIFIER;
}

char|wchar_t|bool|short|int|long|signed|unsigned|float|double|void {
#ifdef DEBUG
	printf("simple_type_spec: %s\n", yytext);
#endif
	yylval = strdup(yytext);
   	return SIMPLE_TYPE_SPEC;
}

{NONDIGIT}({DIGIT}|{NONDIGIT})* {
#ifdef DEBUG
	printf("identifier: %s\n", yytext);
#endif
	yylval =strdup(yytext);
	return IDENTIFIER;
}

\}	/*printf("right brace: %s\n", yytext);*/ return RIGHT_BRACE;
\{	/*printf("left brace: %s\n", yytext);*/ return LEFT_BRACE;
\( return LEFT_CURLY_BRACE;
\) return RIGHT_CURLY_BRACE;
\* return ASTERISK;
\& return AMPERSAND;

;	/*printf("semicolon: %s\n", yytext);*/ return SEMICOLON;
:	/*printf("semicolon: %s\n", yytext);*/ return COLON;
,	/*printf("semicolon: %s\n", yytext);*/ return COMMA;
[ \t\n]+	
. /*printf("znak: %s\n", yytext);*/ return WHATEVER;
